//
//  PercentCurrentSliderPlot.h
//  Balance
//
//  Created by oracle on 7/22/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//



#import <Foundation/Foundation.h>
#import "CorePlot-CocoaTouch.h"
#import "MetricsItem.h"

@protocol PercentCurrentSliderPlotDelegate;

@interface PercentCurrentSliderPlot : NSObject<CPTPlotDataSource,CPTPlotSpaceDelegate, CPTScatterPlotDataSource>
{
@private
    
    CPTGraph *graph;
    CPTScatterPlot *sliderPlot;
    CPTScatterPlot *fromIndicatorPlot; //date range selector: from-date
    CPTScatterPlot *toIndicatorPlot;  //date range selector: to-date
    CPTRangePlot *rangePlot;
	
	
    NSMutableDictionary *metricsData;
    
    
    NSArray *dailyKeys;
    
    NSMutableArray *dailyKeysInRange; 
    
    
    NSInteger totalNoOfDataPoints;
    NSInteger NoOfDataPointsInRange;
    NSArray * monthlyKeys;	
	
    NSString *direction;
    NSInteger previousXPoint;  
    NSInteger fromIndex;
    NSInteger toIndex;
    NSInteger previousFromIndex;
    NSInteger previousToIndex;
    NSInteger selectedCoordination;
    NSInteger numberOfPeriods;
	
    BOOL fromIndicatorPlotSelected, toIndicatorPlotSelected;
    BOOL rangePlotMoved;
    NSDate *startDate;
    MetricsItem *startDateData;
    MetricsItem *endDateData;
    
}

@property (nonatomic, retain) id<PercentCurrentSliderPlotDelegate> delegate;

- (id) initWithMetricsData :(NSMutableDictionary *) data monthlyData:(NSArray *)monthlyData;

- (void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme;
- (void)applyIndicatorPlotColor;    
- (void)highlightPlotColor:(CPTScatterPlot *)plot;


@end

// Delegate to notify the view controller that the location of the line has changed.
@protocol PercentCurrentSliderPlotDelegate <NSObject> 
@required

- (void)sliderPlot:(PercentCurrentSliderPlot *)plot fromDate:(NSString *)fromDateString toDate:(NSString *)toDateString;

@end
